home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Diamond Collection
/
The Diamond Collection (Software Vault)(Digital Impact).ISO
/
cdr49
/
do1st_11.zip
/
DOFIRST.DOC
< prev
next >
Wrap
Text File
|
1995-01-27
|
5KB
|
107 lines
DoFirst
═════════════════════════════════════════════════════════════════
The archive should contain the following files:
DOFIRST.EXE............Actual program
DOFIRST.DOC............Program instructions
RUN.BAT................Sample batch file
READ.ME................Update information (if any)
FILE_ID.DIZ............BBS description file
HUCKABEY.TXT...........Current list of James Huckabey
software
ARCHIVE.TXT............This list of files
Ever need to execute programs on the first day of the month
and worked to try and figure out to do it? DoFirst does it for
you. It is nothing fancy.
Can be run everyday without any harm because it does nothing
at all except update it's log. It generates an exitcode of zero
that means it is the first day of month and a one means that it
is not the first day of the month. Each time it runs it check
your path for a copy of DOFIRST.EXE where it stores it's data
log. It first looks in current directory then your path statement
from the environment. If it finds DOFIRST.EXE it writes it's log
to that location. If it does not find DOFIRST.EXE it then writes
it's log to the current directory.
If it is the first day of the month it checks the log to see
if it has already run. If it has already run it exits with an
error level of 1 same as it would if it were not the 1st day of
the month. If it is the first day of the month and the date in
the log is not the current date the program terminates with an
exitcode of 0. This would be the value that ERRORLEVEL would
contain.
The time in the log is the run time. You can use this to
check and see at what time the program was executed. This goes
for any execution. On the first day of the month the log is only
updated once, on other runnings of the program it's log is
updated.
If on the first day of the month you want to run DoFirst a
second time you must delete it's log DOFIRST.DAT. It is written
to the location of DOFIRST.EXE if located using path of written
to the current directory if not found. When searching is always
checks the current directory first.
If it is not the first day of the month the same search if
performed. If the log is located it is updated showing that it
was not the 1st day of the month. It exits with an ERRORLEVEL 1.
In a batch file the ERRORLEVEL would be equal to 1.
Here is a sample batch file which can be modified to suit:
Echo Off <turn echo off
DOFIRST <run DoFirst
IF ERRORLEVEL 1 GOTO END <if ERRORLEVEL 1 goto exit
(not first day of month)
DoProgram1 <if ERRORLEVEL 0 do programs
DoProgram2 <if any of these are batch
DoProgram3 <files precede with a CALL
CALL Program4 <statement
:END <label for end of batch file
If the place of DoProgram1-4 you can put one batch file if
you prefer. Also keep in mind that if any of these are batch
files that they should be preceded with the 'CALL' command. This
makes each batch file executed return to the calling batch file.
Might not be always necessary but it is the correct procedure.
Any commands after it are never executed unless it returns to the
calling batch file.
This is about all there is to it. DoFirst only produces two
exitcodes 0 or 1. 0=Found and 1=Not Found/Date found and already
executed. The program produces an exitcode of 1 if run more than
once on first day of month. Does not change the log file on
successive executions. Same as file not found: First Day of month
found or First Day of month not found.
Typing in DOFIRST ? produces a simple help screen.
If you have any problems feel free to contact me.
James Huckabey
3621-A Fraser Street
Bellingham, WA 98226-2473 U.S.A.
(360) 671-2868 voice, Pacific
See HUCKABEY.TXT for details on getting all my software.